fix: avoid the race condition when ProtectedRoute is used#118
Merged
brionmario merged 1 commit intoasgardeo:mainfrom Aug 19, 2025
Merged
fix: avoid the race condition when ProtectedRoute is used#118brionmario merged 1 commit intoasgardeo:mainfrom
ProtectedRoute is used#118brionmario merged 1 commit intoasgardeo:mainfrom
Conversation
ProtectedRoute is usedProtectedRoute is used
…ency - Consolidated array declaration for SKIP_PACKAGES into a single line. - Removed unnecessary line breaks and adjusted spacing for function definitions and conditions. - Enhanced code clarity by simplifying the structure of the findChangelogs function.
b2a2bca to
679278a
Compare
pavinduLakshan
approved these changes
Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request introduces improvements to the React client session management and loading state handling, as well as some code style and consistency updates in workflow and script files. The most significant changes focus on making session updates more robust and preventing race conditions during authentication, along with minor refactoring for clarity and maintainability.
React Client & Provider Improvements
isUpdatingSessionflag and logic inAsgardeoProvider.tsxto prevent race conditions and ensure accurate loading and sign-in state during critical session updates such as sign-in, silent sign-in, and organization switching. This helps avoid UI inconsistencies, especially in protected routes. [1] [2] [3] [4] [5] [6] [7] [8] [9]AsgardeoReactClient.ts(getDecodedIdToken,getUserProfile,getCurrentOrganization,getAccessToken) withwithLoadingto ensure consistent loading state management. [1] [2] [3] [4]isSignedInmethod to make it explicitly async and useawait.IdTokeninAsgardeoProvider.tsx.Workflow and Script Consistency
titleandcommitfields in.github/workflows/release.ymlfor consistency, and reformatted theifcondition for readability. [1] [2]scripts/aggregate-changelogs.jsfor better readability and consistency: collapsedSKIP_PACKAGESto a single line, converted some arrow functions to a more concise form, and adjusted function closing brackets. [1] [2] [3]Related Issues
@asgardeo/react&@asgardeo/nextjs#81Related PRs
Checklist
Security checks